package us.feng.tinyspring.io;

import java.io.IOException;
import java.io.InputStream;

import java.net.URL;
import java.net.URLConnection;

public class UrlResource implements Resource{

	private URL url;
	
	public UrlResource(URL url) {
		this.url=url;
	}
	
	@Override
	public InputStream getInputStream() throws IOException {
		URLConnection con=url.openConnection();
		con.connect();
		return con.getInputStream();
	}
	
	public URL getUrl(){
		return this.url;
	}

}
